﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using BuXiaChu.OrderDishes.BLL.WebRuntime;
using BuXiaChu.OrderDishes.BLL;

namespace BuXiaChu.OrderDishes.Web.Admin.ShareCode
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class GetArea : HttpHandlerBase, IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            base.Init(context);
            AjaxActionResult result = new AjaxActionResult();
            var pid = 0;
            if (int.TryParse(Request.Form["pid"], out pid))
            {
                result.obj = AreaManager.GetListByParentId(pid);
                result.success = true;
            }

            SerializeDataToResponseStream(result);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
